home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_066 / assigned / poster < prev   
Text File  |  1992-05-06  |  1KB  |  36 lines

  1. Article 1993 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!hplabs!decwrl!decvax!tektronix!uw-beaver!cornell!batcomputer!hsgj
  3. From: hsgj@batcomputer.tn.cornell.edu (Dan Green)
  4. Newsgroups: comp.sys.amiga
  5. Subject: ASSIGN: solution
  6. Keywords: ASSIGN, Avoiding DOS Insert-Disk Requester
  7. Message-ID: <131@batcomputer.tn.cornell.edu>
  8. Date: 8 Feb 87 00:16:50 GMT
  9. Organization: Theory Center, Cornell U., Ithaca NY
  10. Lines: 107
  11.  
  12. If you remember, I had a problem where I needed to know whether
  13. a name was ASSIGNed before I used it.  Mike Meyer suggested checking
  14. the data structure Assign uses.  Following this advice, I was able to do
  15. just what I wanted.  Anyways, since the solution was prompted by a
  16. net suggestion, I thought I'd share it:
  17.     Included is Assigned() and a test program main().  The way
  18. to use this from a program is like this:
  19.     ...
  20.     if (Assigned("HELP") != AS_UNKNOWN)
  21.         /* Read help file from the help disk or directory */
  22.         show_help_file("HELP:helpfile");
  23.     else
  24.         /* Read help file from the current directory */
  25.         show_help_file("helpfile");
  26.     ...
  27. The sample main() just lets you test it from the keyboard.  Note that
  28. it is highly case-sensitive. In other words, df0 is unknown, but DF0
  29. is a drive.  Note also that you should NOT add a colon: to the name
  30. to be searched.
  31.  
  32. -- Dan Green
  33. -- 
  34. ARPA:  hsgj%vax2.ccs.cornell.edu@cu-arpa.cs.cornell.edu
  35. UUCP:  ihnp4!cornell!batcomputer!hsgj   BITNET:  hsgj@cornella
  36.